package com.jhws.business.card.bo;

import com.alibaba.fastjson.annotation.JSONField;
import com.jhws.common.base.bo.BaseBo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

@Table(name = "card_info")
@Entity
public class TblCardDimBo extends BaseBo {

    /**
     * 序列化
     */
    private static final long serialVersionUID = -4577744445495131884L;

    public static final String RESI_GRPID = "3402223969890";

    /**
     * 卡编号
     */
    @Id
    private String cardNo;
    /**
     * 卡类型
     * s - 超级卡,一般给物管使用
     * n - normal,也就是普通卡，一般给业主使用
     */
    private String cardType;
    /**
     * 该卡业主名称
     */
    private String ownerName;
    /**
     * 该卡业主编号
     */
    private String ownerCode;
    /**
     * 小区编号
     */
    private String commCode;
    /**
     * 该卡持有的业主所在房号信息
     */
    private String roomName;
    /**
     * 该卡状态
     * 01 - 表示使能
     * 02 - 表示手动黑名单了
     * 03 - 表示黑名单后又被恢复了
     * E  - 表示过期了
     */
    private String state;
    /**
     * 这条卡数据信息最后一次的修改时间
     */
    private Date lastModifyTime;

    private Date beginDate;
    private Date endDate;
    /**
     * 毫秒级时间戳，用于存储最后一次修改时间(用来对比)
     */
    @Column(columnDefinition = "BIGINT(20) default 1")
    private Long timestamp;

    @Column(name = "is_synch", columnDefinition = "INT default 0")
    private int isSynch; //是否同步

    public Long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Long timestamp) {
        this.timestamp = timestamp;
    }

    public String getRoomName() {
        return roomName;
    }

    public void setRoomName(String roomName) {
        this.roomName = roomName;
    }

    public String getCardType() {
        return cardType;
    }

    public void setCardType(String cardType) {
        this.cardType = cardType;
    }

    public String getCommCode() {
        return commCode;
    }

    public void setCommCode(String commCode) {
        this.commCode = commCode;
    }

    public Date getLastModifyTime() {
        return lastModifyTime;
    }

    public void setLastModifyTime(Date lastModifyTime) {
        this.lastModifyTime = lastModifyTime;
    }

    public String getOwnerName() {
        return ownerName;
    }

    public void setOwnerName(String ownerName) {
        this.ownerName = ownerName;
    }

    public String getOwnerCode() {
        return ownerCode;
    }

    public void setOwnerCode(String ownerCode) {
        this.ownerCode = ownerCode;
    }

    /**
     * @return the cardNo
     */
    public String getCardNo() {
        return cardNo;
    }

    /**
     * @param cardNo the cardNo to set
     */
    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }

    /**
     * @return the state
     */
    public String getState() {
        return state;
    }

    /**
     * @param state the state to set
     */
    public void setState(String state) {
        this.state = state;
    }

    /**
     * @return the beginDate
     */
    public Date getBeginDate() {
        return beginDate;
    }

    /**
     * @param beginDate the beginDate to set
     */
    public void setBeginDate(Date beginDate) {
        this.beginDate = beginDate;
    }

    /**
     * @return the endDate
     */
    public Date getEndDate() {
        return endDate;
    }

    /**
     * @param endDate the endDate to set
     */
    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public int getIsSynch() {
        return isSynch;
    }

    public void setIsSynch(int isSynch) {
        this.isSynch = isSynch;
    }


    @Override
    public String toString() {
        return "TblCardDimBo{" +
                "cardNo='" + cardNo + '\'' +
                ", cardType='" + cardType + '\'' +
                ", ownerName='" + ownerName + '\'' +
                ", ownerCode='" + ownerCode + '\'' +
                ", commCode='" + commCode + '\'' +
                ", roomName='" + roomName + '\'' +
                ", state='" + state + '\'' +
                ", lastModifyTime=" + lastModifyTime +
                ", beginDate=" + beginDate +
                ", endDate=" + endDate +
                ", timestamp=" + timestamp +
                ", isSynch=" + isSynch +
                '}';
    }
}
